package com.sky.mapper;

import com.sky.entity.Orders;
import org.apache.ibatis.annotations.Mapper;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface OrderMapper {
    /**
     * 保存订单
     * @param orders
     */
    void save(Orders orders);

    /**
     * 根据订单号查询订单
     * @param orderNum
     * @return
     */
    Orders findOrderByOrderNum(String orderNum);

    /**
     * 更新订单状态
     * @param orders
     */
    void update(Orders orders);

    /**
     * 查询所有的超时订单
     * @param time
     * @return
     */
    List<Orders> findOvertimeOrders(LocalDateTime time);

    /**
     * 根据日期获取营业额
     * @param targetDate
     * @return
     */
    Double turnoverStatistics(LocalDate targetDate);
}
